<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/1/25
  Time: 15:28
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>前台登录首页</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">

</head>
<body>

<div style="margin-top: 120px; width:40%; margin-left: auto;margin-right: auto">
    <p class="text-center" style="font-size: 30px"><strong>前台登录</strong></p>
    <form class="form-horizontal" method="get" action="${pageContext.request.contextPath}/userServlet">
        <input type="text" hidden="hidden" name="method" value="login">
        <div class="form-group">
            <label for="Name" class="col-sm-2 control-label">用户名</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" required name="loginUserName" id="Name" placeholder="用户名" style="float: left;width: 60%">
            </div>
        </div>
        <div class="form-group">
            <label for="Name2" class="col-sm-2 control-label">密码</label>
            <div class="col-sm-10">
                <input type="password" class="form-control" required name="loginUserPwd" id="Name2" placeholder="密码" style="float: left;width: 60%">
            </div>
        </div>
        <div class="form-group">
            <label  class="col-sm-2 control-label">验证码</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" required name="verificationCode" placeholder="验证码" style="float: left;width: 60%">
                <img src="validateCodeFront" onclick="changeCode(this);" alt="这是一个验证码" style="float: left">
            </div>

        </div>

        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <input type="submit" class="btn btn-info" value="登录">
                <a  href="${pageContext.request.contextPath}/userRegister.jsp"><button type="button" class="btn btn-default">注册</button></a>


            </div>
            <br>
            <br>

            <a  href="${pageContext.request.contextPath}/index.jsp"><button type="button" class="btn  btn-default btn-sm">后台</button></a>
        </div>
    </form>


</div>
<script src="js/jquery-3.3.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
</body>
</html>

<script>
    function changeCode(obj) {
        obj.src="validateCodeFront?time="+new Date().getTime();
    };
</script>